<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

namespace Buyer\Controller;
use Think\Controller;
class EvaluateController extends \Member\Controller\IndexController {

    public function indexAction(){
		$pagenum=intval($_GET['p']);
		$wheresql=" buyer_uid=$this->uid AND process=1 ";
		$list=M('DataOrder')->token(false)->where($wheresql)->order('dateline DESC')->page($pagenum,10)->select();

		//页码-------------------------------
		$count=M('DataOrder')->token(false)->where($wheresql)->count();
		$Page = new \Think\Page($count,10);
		$this->assign('list',$list);
		$this->assign('page',$Page->show());

		$this->display();	
    }
	
	public function showAction(){
		$oid=intval($_GET['oid']);
		$order= M('DataOrder')->token(false)->where(" oid=$oid AND process=1 ")->find();
		if(empty($order)){
			$this->error('订单评价不存在!','/buyer/evaluate');
			return false;
		}
		
		if($order['buyer_is_evaluate']==1){
			$this->error('订单评价成功!','/buyer/evaluate');
			return false;
		}
		$this->assign('order',$order);
		$this->assign('id',$order['id']);
		$this->display();	
	}

}